<template>
    <div class="child-component">
        <!-- 插槽 -->
        <slot></slot>
        父组件传递得参数：{{ name }}
    </div>
</template>

<script setup lang="ts">
defineProps < {
    name: string;
} > ();
</script>

<style scoped>
.child-component {
    padding: 10px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
}
</style>